package cn.rayland.api;

/**
 * Created by Lei on 2/4/2016.
 */
public class Machine {
    public Axis axis_x;
    public Axis axis_y;
    public Axis axis_z;
    public Extruder extruder_a;
    public Extruder extruder_b;
    public double filamentDiameter;
    public double packingDensity;
    public double nozzleDiameter;
    public int extruderCnt;
    public int timeout;
    public int type;
    public int printTemperature;
    public int holdz;
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((axis_x == null) ? 0 : axis_x.hashCode());
		result = prime * result + ((axis_y == null) ? 0 : axis_y.hashCode());
		result = prime * result + ((axis_z == null) ? 0 : axis_z.hashCode());
		result = prime * result + extruderCnt;
		result = prime * result
				+ ((extruder_a == null) ? 0 : extruder_a.hashCode());
		result = prime * result
				+ ((extruder_b == null) ? 0 : extruder_b.hashCode());
		long temp;
		temp = Double.doubleToLongBits(filamentDiameter);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + holdz;
		temp = Double.doubleToLongBits(nozzleDiameter);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		temp = Double.doubleToLongBits(packingDensity);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + printTemperature;
		result = prime * result + timeout;
		result = prime * result + type;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Machine other = (Machine) obj;
		if (axis_x == null) {
			if (other.axis_x != null)
				return false;
		} else if (!axis_x.equals(other.axis_x))
			return false;
		if (axis_y == null) {
			if (other.axis_y != null)
				return false;
		} else if (!axis_y.equals(other.axis_y))
			return false;
		if (axis_z == null) {
			if (other.axis_z != null)
				return false;
		} else if (!axis_z.equals(other.axis_z))
			return false;
		if (extruderCnt != other.extruderCnt)
			return false;
		if (extruder_a == null) {
			if (other.extruder_a != null)
				return false;
		} else if (!extruder_a.equals(other.extruder_a))
			return false;
		if (extruder_b == null) {
			if (other.extruder_b != null)
				return false;
		} else if (!extruder_b.equals(other.extruder_b))
			return false;
		if (Double.doubleToLongBits(filamentDiameter) != Double
				.doubleToLongBits(other.filamentDiameter))
			return false;
		if (holdz != other.holdz)
			return false;
		if (Double.doubleToLongBits(nozzleDiameter) != Double
				.doubleToLongBits(other.nozzleDiameter))
			return false;
		if (Double.doubleToLongBits(packingDensity) != Double
				.doubleToLongBits(other.packingDensity))
			return false;
		if (printTemperature != other.printTemperature)
			return false;
		if (timeout != other.timeout)
			return false;
		if (type != other.type)
			return false;
		return true;
	}  

    
}
